package com.wiscamp.ninechapters.problems.infrastructure.converters;

import com.wiscamp.ninechapters.problems.domain.models.types.QuestionType;
import com.wiscamp.ninechapters.problems.infrastructure.po.types.QuestionTypePO;
import com.wiscamp.ninechapters.problems.infrastructure.po.types.QuestionTypeView;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface QuestionTypeConverter {
    QuestionTypeConverter Instance = Mappers.getMapper(QuestionTypeConverter.class);

    QuestionTypePO toQuestionTypePO(QuestionType entity);

    QuestionTypePO toQuestionTypePO(QuestionType entity, @MappingTarget QuestionTypePO po);

    QuestionType toQuestionType(QuestionTypePO po);

    QuestionType toQuestionTypeByView(QuestionTypeView view);
}
